using System.Collections.Generic;
namespace Geometry
{
    public struct RectangleWithLevel
    {
       public int level;
        public Rectangle rectangle;
    }

    public class QuadtreeNode
    {
        public QuadtreeTileID id;
        public Rectangle extent;
        public QuadtreeNode pParent;
        public QuadtreeNode ll;
        public QuadtreeNode lr;
        public QuadtreeNode ul;
        public QuadtreeNode ur;
        public List<RectangleWithLevel> rectangles;
        public QuadtreeNode(QuadtreeTileID id_, Rectangle extent_, QuadtreeNode pParent_)
        {
            this.id = id_;
            this.extent = extent_;
            this.pParent = pParent_;
            this.rectangles=new List<RectangleWithLevel>();
        }

        public static implicit operator bool(QuadtreeNode self)
        {
            return self == null ? false : true;
        }

    }
}